<header>
  <div class="top">
    <div class="box">
      <div class="welcome">欢迎<a href="@if(! Auth::check())/login/@else/user/@endif" target="_blank">{{Auth::user()->name??'登录'}}</a>访问“代码示例网”代码示例网提供编程语言学习和Web开发教程，同时分享个人经历和互联网事件的见解和观点。</div>
      <!--guanzhu end-->
      <div class="is-search"><i></i></div>
      <div class="search-page">
        <div class="search_box">
          <div class="go-left"></div>
          <div class="search">
            <form action="/search/" method="post" name="searchform" id="searchform" onsubmit="searchFunction()">
			  @csrf
              <input name="keyboard" id="keyboard" class="input_text" value="请输入关键字词" style="color: rgb(153, 153, 153);" onfocus="if(value=='请输入关键字词'){this.style.color='#000';value=''}" onblur="if(value==''){this.style.color='#999';value='请输入关键字词'}" type="text">
				<select name="tbname">
				  <option value="">全部</option>
				  @foreach($cats as $cat)
				  <option value="{{$cat['cat_id']}}">{{$cat['catname']}}</option>
				  @endforeach
				</select>
              <input class="input_submit" value="搜索" type="submit">
            </form>
			<script> window.history.replaceState(null, null, window.location.href);
			function searchFunction(){ document.getElementById('searchform').action = "/search/" + document.getElementsByName("keyboard")[0].value; } </script> 
          </div>
          <div class="clear"></div>
          <div class="hot-search">
            <p>热门搜索/Hot Search</p>
            <ul class="search-paihang">
			@foreach($searchhis as $search)
			<li><a href="/search/{{$search['keywords']}}">{{$search['keywords']}}</a></li>
			@endforeach	
            </ul>
          </div>
        </div>
      </div>
      <!--search-page end--> 
    </div>
  </div>
  <!--top end-->
  <div id="mnavh"><span class="navicon"></span></div>
  <div class="menus">
  <div class="btn_menu"></div>
  <div class="menu_sub">
    <dl>
      <dt>主导航</dt><dd><a href="{{request()->schemeAndHttpHost()}}" title="代码示例网">网站首页</a></dd>
    </dl>
    <dl>
      <dt>分类</dt>
	  @foreach($cats as $cat)
      <dd><a href="/{{$cat['pinyin']}}/">{{$cat['catname']}}</a></dd>
	  @endforeach
    </dl>
    <dl>
      <dt>其他</dt>
      <dd><a href="/files/">文件下载</a></dd>
	  <dd><a href="/games/">在线小游戏</a></dd>
	  <dd><a href="/files/">在线小工具</a></dd>
	  <dd><a href="/xiuxian/">文字修仙</a></dd>
	  <dd><a href="/tags/">标签列表</a></dd>
    </dl>
  </div>
</div>
</header>